Repository navigation
fix(ollama): reject a proxy endpoint on its upstream daemon's port - #14909
Open
shaojunying wants to merge 1 commit into
Open
shaojunying wants to merge 1 commit into
shaojunying wants to merge 1 commit into
Conversation
The proxy shares the host network and, before each request, rejects any non-loopback listener on the daemon's port. A proxy endpoint such as http://172.20.0.1:11434/v1 in front of a daemon on 127.0.0.1:11434 passed validation, started, and then answered every request with 502, because the check found the proxy's own listener. Signed-off-by: shaojunying <30252316+shaojunying@users.noreply.github.com>
Author
Authoring session — opening
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Validation now rejects an
ollamaProxyservice whoseendpointuses the upstream daemon's port, instead of accepting a proxy that answers every request with 502.Problem
The proxy shares the host network and, before each request, rejects any non-loopback listener on the daemon's port.
Validation compared only the two URL strings, so
endpoint: http://172.20.0.1:11434/v1in front ofupstream.endpoint: http://127.0.0.1:11434/v1passed.The proxy checks the daemon before it binds, so it started. After that, each request found the proxy's own
172.20.0.1:11434listener, failed the check, and returned 502 without the reason.Resolves #14907.
Change
proxy_rejects_an_endpoint_on_the_daemon_port, which failed before the change.Beyond CI
I did not run the proxy against a live Ollama daemon. The 502 path comes from
Proxy::start,dispatch, andloopback_listenerincrates/nemoclaw-ollama-proxy/src/lib.rs.Signed-off-by: shaojunying 30252316+shaojunying@users.noreply.github.com